import { AppstoreAddOutlined, HomeOutlined, UsergroupAddOutlined, UserOutlined } from "@ant-design/icons"
import { ReactNode } from "react"

export type RouteItemType = {
    path: string
    title: string
    icon?: string
    disable?: boolean // default = false
    hideInMenu?: boolean // default = false
    children?: RouteItemType[]
}

const RouteConfig: RouteItemType[] = [{
    path: "home",
    title: "首页",
    icon: "HomeOutlined",
}, {
    path: "user",
    title: "用户",
    icon: "UserOutlined",
    children: [{
        path: "userIndex",
        title: "用户首页",
        icon: "UsergroupAddOutlined",
    }, {
        path: "userManage",
        title: "用户管理",
        icon: "AppstoreAddOutlined",
        children: [{
            path: "userDetail",
            title: "用户详情",
            hideInMenu: true,
        }]
    }]
}]

export default RouteConfig;

// 规则：key对应Icon名， value对应Icon组件,或者自定义组件
// 如需新增Icon，请参考：https://ant.design/components/icon-cn/

export const MenuIconConfig: any = {
    HomeOutlined: <HomeOutlined />,
    AppstoreAddOutlined: <AppstoreAddOutlined />,
    UsergroupAddOutlined: <UsergroupAddOutlined />,
    UserOutlined: <UserOutlined />,
}